Many computer systems are required to process large amounts of image or bitmap data. Such computer systems are frequently operating with restricted memory resources, and as such, these computer systems often compress data to reduce the amount of memory required during processing.
One example of such a computer system is a Raster Image Processing System. A Raster Image Processor (RIP) takes the digital information about fonts and graphics that describes the appearance of a document and translates the information into an image composed of individual pixels that the imaging device such as a printer can output. A number of types of Raster Image Processors are known in the art. These include frame-store RIP's, band-store RIP's and tile-order RIP's.
In the tile RIP, the page is divided up into square tiles. Each tile is fully rendered before the RIP starts rendering the next tile. With such a RIP, an output compressor may start compression of a rendered tile as soon as it is available, provided that the compressor can accept data in tile order.
When choosing a compression method, it is important to use a method that is appropriate for the type of data being compressed. These methods can broadly be categorized as either lossy or lossless.
A hybrid compression strategy that utilises both lossless and lossy compression algorithms is often used to compress the output of a Raster Image Processor, in which the rendered bitmap is segmented into flat regions and image regions. In general, this is a successful strategy in achieving high image quality while maintaining a reasonable compression ratio. However, in a system where memory resource is scarce, adjustments need to be made to the compression strategy in order to achieve compression to within a target memory size (or allowable memory capacity).
For example, in a typical JPEG compression process, the DCT coefficients are quantized using a quantization table, which can be used to control the size of the final coded image. The higher the quantisation level, the more perceptible information is lost during the quantisation.
A hybrid strategy that employs JPEG as its lossy compression algorithm can adjust its lossy compression ratio by adjusting the quantisation level. If the initial compression fails to satisfy the target memory, then a recompression with a higher quantisation level is needed. However, it is hard to predict the memory saving that can be achieved by setting a certain quantisation level. Therefore, more than one attempt of recompression is needed by adjusting the quantisation level incrementally each time, until reaching the level that is appropriate for a given target memory.
Another method of controlling the size of an encoded image is to discard the image's DCT coefficients, starting from the highest order coefficient and stopping once a desired target memory is reached. This is feasible because the majority of the visual information in the image is encoded within the DC and lower AC coefficients.
A method of spectral JPEG encoding of images can be used, in which higher order AC coefficients can be deleted without the need for recompression. For each DCT coding block, the quantised coefficients are stored within spectral bands of decreasing visual significance. The increasing order of the DCT coefficients is directly related to their decreasing impact on the visual quality of the image. Hence the encoded DCT coefficients can be grouped into spectral partitions that are sorted by decreasing relevance to the overall image quality. In this arrangement, the image quality can be degraded as little as necessary through the deletion of the higher spectral partitions and their associated encoded DCT coefficients. In this way it is possible to reclaim memory adaptively, by removing the less relevant partitions first, and there is no need for recompression. Furthermore, to reduce the size of the losslessly-compressed data, the processor re-segments the image by setting a more aggressive region segmentation parameter, so that more regions can be classified as image regions in the recompression process.
One method for classifying more regions as image regions dynamically adjusts both compression and segmentation parameters to maintain the instant compression ratio within a tolerance interval. The method recompresses the document strip by strip till the overall compression ratio meets the requirement. However, adjusting the compression and segmentation parameters strip by strip can lead to inconsistent quality throughout the page. Having a recompression decision based on an instant compression ratio instead of the final overall compression ratio can lead to premature optimization and cause unnecessary quality loss. Most of all, the entire image can potentially be recompressed more than once, as it is hard to determine the memory saving that can be achieved by adjusting such a parameter before recompression occurs.
Another method discloses a block-based hybrid compression system, whereby the compression ratio is controlled by adjusting the threshold used in classifying the blocks as solid or image. A mapping between the number of solid blocks and a value of the classification threshold is stored. Each point in the mapping indicates the number of blocks that can be classified as solid if such a classification threshold value is chosen. This information gives a rough indication of the compression ratio for a given classification threshold value, which is then used to adjust the threshold value when recompression is needed. However, a compression ratio cannot be accurately predicted simply by using the number of solid blocks, which means that an attempted recompression may fail to meet the desired compression ratio. Other methods for reducing memory usage in the case when recompression fails to meet the desired compression ratio include image decimation, increased quantisation step size or selective quantisation for darker regions. The disadvantage of these other methods is the requirement for additional rounds of recompression that must be performed when that happens, till the desired compression ratio is met.